package tools.cyan.com.myapplication.module.model;

import com.cyan.tools.bean.Result;
import com.cyan.tools.callback.RequestCallback;
import com.cyan.tools.util.SimpleSubscriber;

import java.util.ArrayList;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import tools.cyan.com.myapplication.app.App;
import tools.cyan.com.myapplication.bean.PhoneRecord;
import tools.cyan.com.myapplication.module.contract.TestContract;

/**
 * Created by pc on 2018/4/25.
 */

public class TestModelImpl implements TestContract.Model{
    @Override
    public void getPhoneRecords(RequestCallback<ArrayList<PhoneRecord>> requestCallback, String id, int limit) {
        App.getComponent().getAPIService().getPhoneRecords(id,limit).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SimpleSubscriber<Result<ArrayList<PhoneRecord>>>(requestCallback));
    }
}
